import Vue from "vue";
import Modal from "./modal.vue";

const ModalClass = Vue.extend(Modal);

function CreateModal(options) {
  if (Object.prototype.toString.call(options) !== "[object Object]") return;

  let instance = new ModalClass({ data: options });
  instance.$mount();

  document.body.appendChild(instance.$el);

  return instance;
}

export default CreateModal;
